package com.skytech.chatim.sky.retrofit;

import java.util.Map;

import retrofit.Callback;
import retrofit.http.Body;
import retrofit.http.DELETE;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.GET;
import retrofit.http.Headers;
import retrofit.http.Multipart;
import retrofit.http.POST;
import retrofit.http.PUT;
import retrofit.http.Part;
import retrofit.http.Path;
import retrofit.http.QueryMap;
import retrofit.mime.TypedFile;

import com.skytech.chatim.sky.vo.HxUserResponse;
import com.skytech.chatim.sky.vo.JoinLinkPara;
import com.skytech.chatim.sky.vo.ListUserResponse;
import com.skytech.chatim.sky.vo.LoginEasemobResponse;
import com.skytech.chatim.sky.vo.LoginResponse;
import com.skytech.chatim.sky.vo.MeetingLinkResponse;
import com.skytech.chatim.sky.vo.RestResponse;
import com.skytech.chatim.sky.vo.SkyUser;
import com.skytech.chatim.sky.vo.SkyUserResponse;
import com.skytech.chatim.sky.vo.StartLinkPara;
import com.skytech.chatim.sky.vo.UploadFile;

public interface ServerInterface {
    public static final String BASE ="/test/im-backend/v1/";
    @FormUrlEncoded
    @POST(BASE+"login")
    void login(@Field("username") String username, @Field("password") String password ,Callback<LoginResponse> callback);
 
    @FormUrlEncoded
    @POST(BASE+"login/easemob")
    void loginEasemob(@Field("username") String username, @Field("password") String password , Callback<LoginEasemobResponse> callback);
   
    //@Headers("Content-Type:application/json")
    //@POST(BASE+"webex/join/android")
    //void getMeetingLink(@Body  WebexAccount account, Callback<MeetingLinkResponse> callback);
    
    
    @Headers("Content-Type:application/json")
    @POST(BASE+"webex/start/android")
    void getMeetingStartLink(@Body  StartLinkPara linkPara, Callback<MeetingLinkResponse> callback);
    
    
    @Headers("Content-Type:application/json")
    @POST(BASE+"webex/join/android")
    void getMeetingJoinLink(@Body  JoinLinkPara linkPara, Callback<MeetingLinkResponse> callback);
    

    @GET(BASE+"users")
    void listUser(@QueryMap Map<String, String> options ,Callback<ListUserResponse> callback);

    @POST(BASE+"users/{username}/friends/{firendname}")
    void addFriend(@Path("username") String username, @Path("firendname") String firendname,@Body String emptyString,Callback<RestResponse> callback);
    

    @DELETE(BASE+"users/{username}/friends/{firendname}")
    void deleteFriend(@Path("username") String username, @Path("firendname") String firendname,Callback<RestResponse> callback);


    @GET(BASE+"users/{username}/detail")
    void getSkyUser(@Path("username") String username, Callback<SkyUserResponse> callback);


    @GET(BASE+"users/{username}/account")
    void getHxUser(@Path("username") String username,Callback<HxUserResponse> callback);
   

    @Multipart
    @POST(BASE+"files/{username}")
    void upload(@Part("file") TypedFile file ,@Path("username") String username,Callback<UploadFile> callback);

    @Headers("Content-Type:application/json")
    @PUT(BASE+"users/{username}/detail")
    void updateUser(@Path("username") String username, @Body  SkyUser updateUser, Callback<SkyUserResponse> callback);

}
